﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Web.View.c30_jjzhMenu.Default" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>c30_jjzh</title>
    <script src="/View/js/Alert.js" type="text/javascript"></script> 
    <script type="text/javascript">
        function SetWinData(index) {
            document.getElementById("Hid").value = c30_jjzh_MainStore.getAt(index).get('dqdm');
            
			Txtnf.setValue(c30_jjzh_MainStore.getAt(index).get('nf'));
			Txtkhm.setValue(c30_jjzh_MainStore.getAt(index).get('khm'));
			Txtkhzh.setValue(c30_jjzh_MainStore.getAt(index).get('khzh'));
			Txtkhyh.setValue(c30_jjzh_MainStore.getAt(index).get('khyh'));
			Txtkhr.setValue(c30_jjzh_MainStore.getAt(index).get('khr'));
			Txtjjje.setValue(c30_jjzh_MainStore.getAt(index).get('jjje'));
			Txtzybz.setValue(c30_jjzh_MainStore.getAt(index).get('zybz'));
			Txtsjbz.setValue(c30_jjzh_MainStore.getAt(index).get('sjbz'));
			Txtshbz.setValue(c30_jjzh_MainStore.getAt(index).get('shbz'));
			Txtxjbz.setValue(c30_jjzh_MainStore.getAt(index).get('xjbz'));
			Txtxibz.setValue(c30_jjzh_MainStore.getAt(index).get('xibz'));
			Txtnmjn.setValue(c30_jjzh_MainStore.getAt(index).get('nmjn'));
			Txtmzbz.setValue(c30_jjzh_MainStore.getAt(index).get('mzbz'));
			Txtxcbz.setValue(c30_jjzh_MainStore.getAt(index).get('xcbz'));
			Txtqtbz.setValue(c30_jjzh_MainStore.getAt(index).get('qtbz'));
			Txtgcjy.setValue(c30_jjzh_MainStore.getAt(index).get('gcjy'));
			Txtyljy.setValue(c30_jjzh_MainStore.getAt(index).get('yljy'));
			Txtfxjy.setValue(c30_jjzh_MainStore.getAt(index).get('fxjy'));
			Txtbndjy.setValue(c30_jjzh_MainStore.getAt(index).get('bndjy'));
			Txtbnyljy.setValue(c30_jjzh_MainStore.getAt(index).get('bnyljy'));
			Txtbnfxjy.setValue(c30_jjzh_MainStore.getAt(index).get('bnfxjy'));
			Txtsnjy.setValue(c30_jjzh_MainStore.getAt(index).get('snjy'));
			Txtbnsjje.setValue(c30_jjzh_MainStore.getAt(index).get('bnsjje'));
			Txtstate.setValue(c30_jjzh_MainStore.getAt(index).get('state'));

            c30_jjzh_Win.show();
        }
    </script>
</head>
<body>
    <form id="MainForm" runat="server">
    <ext:ResourceManager ID="MainResourceMgr" runat="server" />
    <!--用来导出到Excel的数据源-->
    <ext:Hidden ID="ExcelGridData" runat="server" />
    <!--c30_jjzh表页面主数据元，自动生成-->
    <ext:Store runat="server" ID="c30_jjzh_MainStore" OnRefreshData="c30_jjzh_DataBind" AutoLoad="true">
        <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="dqdm">
                <Fields>
                    
					<ext:RecordField Name="dqdm" />
					<ext:RecordField Name="nf" />
					<ext:RecordField Name="khm" />
					<ext:RecordField Name="khzh" />
					<ext:RecordField Name="khyh" />
					<ext:RecordField Name="khr" />
					<ext:RecordField Name="jjje" />
					<ext:RecordField Name="zybz" />
					<ext:RecordField Name="sjbz" />
					<ext:RecordField Name="shbz" />
					<ext:RecordField Name="xjbz" />
					<ext:RecordField Name="xibz" />
					<ext:RecordField Name="nmjn" />
					<ext:RecordField Name="mzbz" />
					<ext:RecordField Name="xcbz" />
					<ext:RecordField Name="qtbz" />
					<ext:RecordField Name="gcjy" />
					<ext:RecordField Name="yljy" />
					<ext:RecordField Name="fxjy" />
					<ext:RecordField Name="bndjy" />
					<ext:RecordField Name="bnyljy" />
					<ext:RecordField Name="bnfxjy" />
					<ext:RecordField Name="snjy" />
					<ext:RecordField Name="bnsjje" />
					<ext:RecordField Name="state" />

                </Fields>
            </ext:JsonReader>
        </Reader> 
        <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw">
            </ext:Parameter>
            <ext:Parameter Name="limit" Value="15" Mode="Raw">
            </ext:Parameter>
        </BaseParams>
    </ext:Store>
    <!--c30_jjzh页面主表格-->
    <ext:Viewport ID="MainViewPort" runat="server">
        <Items>
            <ext:FitLayout>
                <Items>
                    <ext:GridPanel ID="c30_jjzh_Grid" Layout="fit" TrackMouseOver="true" runat="server" StoreID="c30_jjzh_MainStore"
                        StripeRows="true" Header="false" Border="false" Collapsible="true">
                        <TopBar>
                            <ext:Toolbar ID="MainToolBar" runat="server">
                                <Items>
                                    <ext:Button ID="BtnAdd" runat="server" Text="添加" Icon="Add">
                                        <Listeners>
                                            <Click Handler="#{c30_jjzh_MainForm}.getForm().reset();#{Hid}.setValue('');#{c30_jjzh_Win}.show();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="BtnDel" runat="server" Text="删除" Icon="Delete">
                                        <DirectEvents>
                                            <Click OnEvent="BtnDel_Click">
                                                <Confirmation ConfirmRequest="true" Title="确认" Message="确实要删除吗?" />
                                                <EventMask ShowMask="true" Msg="正在删除数据，请等候 ..." />
                                            </Click>
                                        </DirectEvents>
                                        <Listeners>
                                            <Click Handler="if(#{c30_jjzh_Grid}.getSelectionModel().getCount()<=0) {TellAlert('请选择要删除的记录');return false;}" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarSeparator />
                                    <ext:Button ID="BtnReload" runat="server" Text="重新加载" Icon="Reload">
                                        <Listeners>
                                            <Click Handler="#{c30_jjzh_MainStore}.reload();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarFill />
                                    <ext:Button ID="BtnToExcel" runat="server" Text="To Excel" AutoPostBack="true" OnClick="BtnSaveToExcel"
                                        Icon="PageExcel">
                                        <Listeners>
                                            <Click Handler="#{ExcelGridData}.setValue(Ext.encode(c30_jjzh_Grid.getRowsValues(false)));" />
                                        </Listeners>
                                        <ToolTips>
                                            <ext:ToolTip Title="将当前页内容存储为Excel文件">
                                            </ext:ToolTip>
                                        </ToolTips>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <ColumnModel ID="c30_jjzh_ColumnMode" runat="server">
                            <Columns>
                                <ext:RowNumbererColumn Width="20" />
                                <ext:Column Header="主键" Sortable="true" Hidden="true" DataIndex="dqdm" />
                                
								<ext:Column Header="nf" Sortable="true" DataIndex="nf" />
								<ext:Column Header="khm" Sortable="true" DataIndex="khm" />
								<ext:Column Header="khzh" Sortable="true" DataIndex="khzh" />
								<ext:Column Header="khyh" Sortable="true" DataIndex="khyh" />
								<ext:Column Header="khr" Sortable="true" DataIndex="khr" />
								<ext:Column Header="jjje" Sortable="true" DataIndex="jjje" />
								<ext:Column Header="zybz" Sortable="true" DataIndex="zybz" />
								<ext:Column Header="sjbz" Sortable="true" DataIndex="sjbz" />
								<ext:Column Header="shbz" Sortable="true" DataIndex="shbz" />
								<ext:Column Header="xjbz" Sortable="true" DataIndex="xjbz" />
								<ext:Column Header="xibz" Sortable="true" DataIndex="xibz" />
								<ext:Column Header="nmjn" Sortable="true" DataIndex="nmjn" />
								<ext:Column Header="mzbz" Sortable="true" DataIndex="mzbz" />
								<ext:Column Header="xcbz" Sortable="true" DataIndex="xcbz" />
								<ext:Column Header="qtbz" Sortable="true" DataIndex="qtbz" />
								<ext:Column Header="gcjy" Sortable="true" DataIndex="gcjy" />
								<ext:Column Header="yljy" Sortable="true" DataIndex="yljy" />
								<ext:Column Header="fxjy" Sortable="true" DataIndex="fxjy" />
								<ext:Column Header="bndjy" Sortable="true" DataIndex="bndjy" />
								<ext:Column Header="bnyljy" Sortable="true" DataIndex="bnyljy" />
								<ext:Column Header="bnfxjy" Sortable="true" DataIndex="bnfxjy" />
								<ext:Column Header="snjy" Sortable="true" DataIndex="snjy" />
								<ext:Column Header="bnsjje" Sortable="true" DataIndex="bnsjje" />
								<ext:Column Header="state" Sortable="true" DataIndex="state" />

                            </Columns>
                        </ColumnModel>
                        <Listeners>
                            <RowDblClick Handler="SetWinData(rowIndex);" />
                        </Listeners>
                        <Plugins>
                            <ext:GridFilters runat="server" FiltersText="查找" ID="c30_jjzh_Filter">
                                <Filters>
                                    
								<ext:StringFilter DataIndex="nf" />
								<ext:StringFilter DataIndex="khm" />
								<ext:StringFilter DataIndex="khzh" />
								<ext:StringFilter DataIndex="khyh" />
								<ext:StringFilter DataIndex="khr" />
								<ext:StringFilter DataIndex="jjje" />
								<ext:StringFilter DataIndex="zybz" />
								<ext:StringFilter DataIndex="sjbz" />
								<ext:StringFilter DataIndex="shbz" />
								<ext:StringFilter DataIndex="xjbz" />
								<ext:StringFilter DataIndex="xibz" />
								<ext:StringFilter DataIndex="nmjn" />
								<ext:StringFilter DataIndex="mzbz" />
								<ext:StringFilter DataIndex="xcbz" />
								<ext:StringFilter DataIndex="qtbz" />
								<ext:StringFilter DataIndex="gcjy" />
								<ext:StringFilter DataIndex="yljy" />
								<ext:StringFilter DataIndex="fxjy" />
								<ext:StringFilter DataIndex="bndjy" />
								<ext:StringFilter DataIndex="bnyljy" />
								<ext:StringFilter DataIndex="bnfxjy" />
								<ext:StringFilter DataIndex="snjy" />
								<ext:StringFilter DataIndex="bnsjje" />
								<ext:StringFilter DataIndex="state" />

                                </Filters>
                            </ext:GridFilters>
                        </Plugins>
                        <LoadMask ShowMask="true" Msg="正在加载..." />
                        <SelectionModel>
                            <ext:CheckboxSelectionModel ID="CheckBoxGrid" runat="server" />
                        </SelectionModel>
                        <BottomBar>
                            <ext:PagingToolbar ID="PagingToolBar" StoreID="c30_jjzh_MainStore" PageSize="15" runat="server" />
                        </BottomBar>
                    </ext:GridPanel>
                </Items>
            </ext:FitLayout>
        </Items>
    </ext:Viewport>
    
    <!--c30_jjzh表修改，添加主窗体-->
    <ext:Window ID="c30_jjzh_Win" Collapsible="true" Hidden="true" Modal="true"
        Maximizable="true" runat="server" Title="添加/修改记录" Icon="WorldEdit" Width="630" AutoHeight="true"
        Resizable="true">
        <Items>
            <ext:Hidden ID="Hid" runat="server">
            </ext:Hidden>
            <ext:FormPanel ID="c30_jjzh_MainForm" LabelWidth="65" Frame="true" runat="server"
                Border="false" Height="390" Padding="5" Icon="UserAdd" Layout="Column">
                <Items>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items>
                            
							<ext:TextField ID="Txtnf" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="nf" />
							<ext:TextField ID="Txtkhzh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="khzh" />
							<ext:TextField ID="Txtkhr" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="khr" />
							<ext:TextField ID="Txtzybz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="zybz" />
							<ext:TextField ID="Txtshbz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="shbz" />
							<ext:TextField ID="Txtxibz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="xibz" />
							<ext:TextField ID="Txtmzbz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="mzbz" />
							<ext:TextField ID="Txtqtbz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="qtbz" />
							<ext:TextField ID="Txtyljy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="yljy" />
							<ext:TextField ID="Txtbndjy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="bndjy" />
							<ext:TextField ID="Txtbnfxjy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="bnfxjy" />
							<ext:TextField ID="Txtbnsjje" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="bnsjje" />

                        </Items>
                    </ext:Panel>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items> 
                            
							<ext:TextField ID="Txtkhm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="khm" />
							<ext:TextField ID="Txtkhyh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="khyh" />
							<ext:TextField ID="Txtjjje" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="jjje" />
							<ext:TextField ID="Txtsjbz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="sjbz" />
							<ext:TextField ID="Txtxjbz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="xjbz" />
							<ext:TextField ID="Txtnmjn" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="nmjn" />
							<ext:TextField ID="Txtxcbz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="xcbz" />
							<ext:TextField ID="Txtgcjy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="gcjy" />
							<ext:TextField ID="Txtfxjy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="fxjy" />
							<ext:TextField ID="Txtbnyljy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="bnyljy" />
							<ext:TextField ID="Txtsnjy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="snjy" />
							<ext:TextField ID="Txtstate" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="state" />

                        </Items>
                    </ext:Panel>
                </Items>
            </ext:FormPanel>
        </Items>
        <Buttons> 
            <ext:Button Text="提交" ID="BtnSave" runat="server" Icon="Disk">
                <DirectEvents>
                    <Click OnEvent="BtnSave_Click">
                        <EventMask ShowMask="true" Msg="正在提交，请等候 ..."  />
                    </Click>
                </DirectEvents>
                <Listeners>
                    <Click Handler="if (#{c30_jjzh_MainForm}.getForm().isValid()) {;}else{Ext.Msg.show({icon: Ext.MessageBox.ERROR, msg: '您填写的信息不正确，请您确认！', buttons:Ext.Msg.OK});return false;}" />
                </Listeners>
            </ext:Button>
            <ext:Button Text="取消" ID="BtnConcel" Icon="Delete">
                <Listeners>
                    <Click Handler="#{c30_jjzh_Win}.hide();" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
    </form>
</body>
</html>
